Music Object Extension - Wizards

  Contents

About This Extension

This extension adds methods that let you easily sonify all form elements and links on a page in a single step, without having to add JavaScript code to all the elements you wish to sonify.

What's New in the Latest Version

There is a dedicated version history for this extension, where you will be able to find out about the new features and possible issues with the most recent version. The version history for this extension is independent of the version history for the core Music Object API.

Getting This Extension

To get the "music-object-x-wizards.js" JavaScript file that implements this extension, simply right-click on this link (click-and-hold for Mac users). Then, from the menu that pops up, select the 'Save Link As...' or 'Save Target As...' option and save the file as "music-object-x-wizards.js" into an appropriate folder of the local copy of your Web site.

In case you have problems saving the file using the above link, the "music-object-x-wizards.js" file can also be found inside the documentation's "javascript" folder, along with the "music-object.js" file.

Dependencies

In order to use this extension, the following JavaScript file(s) must first be sourced in...

For more information on using extensions, consult the section About Music Object Extensions.

Reference

 Name   Short Description 
Static Methods
Music.addLinkLabel Lets you add custom labels to links, so that groups of links can be specified when sonifying links.
Music.sonifyFormsWithGroovoids Lets you easily sonify all of the form elements on an HTML page in one step, using Groovoids.
Music.sonifyFormsWithHandlers Lets you easily sonify all of the form elements on an HTML page in one step, using your own custom event handlers.
Music.sonifyLinksWithGroovoids Lets you easily sonify all (or a subset) of the links on an HTML page in one step, using Groovoids.
Music.sonifyLinksWithHandlers Lets you easily sonify all (or a subset) of the links on an HTML page in one step, using your own custom event handlers.
Static Properties
Music.noManualHandlers A boolean indicating if the HTML elements to be automatically sonified have no manually coded event handlers.

Static Methods

 Music.addLinkLabel

 
 CATEGORY   Static Method 
 MODULE   Music Object Extension - Wizards 
 Min. Player Version   n/a 
 

The Music.addLinkLabel static method lets you attach labels to links so that groups of links can be specified when using the Music.sonifyLinksWithGroovoids and Music.sonifyLinksWithHandlers static methods.

SYNTAX    Music.addLinkLabel ( LinkLabelSTR )

A group of links is identified by specifying the labels of the start and end links in a series of links. Optionally, a label prefix can be used to identify only certain links from the group of links specified by the start and end link labels. A label can be added to a link by adding a call to the Music.addLinkLabel method to the link's ONCLICK, ONMOUSEOVER, or ONMOUSEOUT event handlers. Multiple labels can be added to the same link by adding multiple calls to the Music.addLinkLabel method to the link's event handlers.

In the example below, the link labels "start chunky links" and "end chunky links" can be used to identify the group of links containing the links "Link 05", "Link 06", "Link 07", "Link 08", "Link 09", "Link 10", and "Link 11".

<A HREF="link01.html">Link 01</A>
<A HREF="link02.html">Link 02</A>
<A HREF="link03.html">Link 03</A>
<A HREF="link04.html">Link 04</A>
<A HREF="link05.html" ONCLICK="Music.addLinkLabel ('start chunky links')">Link 05</A>
<A HREF="link06.html">Link 06</A>
<A HREF="link07.html">Link 07</A>
<A HREF="link08.html">Link 08</A>
<A HREF="link09.html">Link 09</A>
<A HREF="link10.html">Link 10</A>
<A HREF="link11.html" ONCLICK="Music.addLinkLabel ('end chunky links')">Link 11</A>
<A HREF="link12.html">Link 12</A>
<A HREF="link13.html">Link 13</A>
<A HREF="link14.html">Link 14</A>

Overlapping groups of links can also be specified using link labels. The link labels in the following example could be used to specify two overlapping link groups. The first group can be specified using the link labels "start mouseovers" and "end mouseovers", and would contain the links "Link 02", "Link 03", "Link 04", "Link 05", "Link 06", "Link 07", and "Link 08". The second group can be specified using the link labels "start clicks" and "end clicks", and would contain the links "Link 05", "Link 06", "Link 07", "Link 08", "Link 09", "Link 10", "Link 11", and "Link 12".

<A HREF="link01.html">Link 01</A>
<A HREF="link02.html" ONCLICK="Music.addLinkLabel ('start mouseovers')">Link 02</A>
<A HREF="link03.html">Link 03</A>
<A HREF="link04.html">Link 04</A>
<A HREF="link05.html" ONCLICK="Music.addLinkLabel ('start clicks')">Link 05</A>
<A HREF="link06.html">Link 06</A>
<A HREF="link07.html">Link 07</A>
<A HREF="link08.html" ONCLICK="Music.addLinkLabel ('end mouseovers')">Link 08</A>
<A HREF="link09.html">Link 09</A>
<A HREF="link10.html">Link 10</A>
<A HREF="link11.html">Link 11</A>
<A HREF="link12.html" ONCLICK="Music.addLinkLabel ('end clicks')">Link 12</A>
<A HREF="link13.html">Link 13</A>
<A HREF="link14.html">Link 14</A>

Now, if either the Music.sonifyLinksWithGroovoids or Music.sonifyLinksWithHandlers method was used to add a sonification behavior to the ONMOUSEOVER event of all the links in the group specified by the "start mouseovers" and "end mouseovers" labels, and if either the Music.sonifyLinksWithGroovoids or Music.sonifyLinksWithHandlers method was used to add a sonification behavior to the ONCLICK event of all the links in the group specified by the "start click" and "end click" labels, then the links from "Link 05" to "Link 08" would have sonification behaviors for both the ONMOUSEOVER and ONCLICK events, while the links from "Link 02" to "Link 04" would have a sonification behavior for just the ONMOUSEOVER event, and the links from "Link 09" to "Link 12" would have a sonification behavior for just the ONCLICK event. The remaining links - "Link 01", "Link 13", and "Link 14" - would have no sonification behaviors for any events.

In the next example, the link label prefix "chunky link" can be used to identify the group of links containing the links "Link 02", "Link 05", "Link 08", "Link 11", and "Link 13".

<A HREF="link01.html">Link 01</A>
<A HREF="link02.html" ONCLICK="Music.addLinkLabel ('chunky link')">Link 02</A>
<A HREF="link03.html">Link 03</A>
<A HREF="link04.html">Link 04</A>
<A HREF="link05.html" ONCLICK="Music.addLinkLabel ('chunky link')">Link 05</A>
<A HREF="link06.html">Link 06</A>
<A HREF="link07.html">Link 07</A>
<A HREF="link08.html" ONCLICK="Music.addLinkLabel ('chunky link')">Link 08</A>
<A HREF="link09.html">Link 09</A>
<A HREF="link10.html">Link 10</A>
<A HREF="link11.html" ONCLICK="Music.addLinkLabel ('chunky link')">Link 11</A>
<A HREF="link12.html">Link 12</A>
<A HREF="link13.html" ONCLICK="Music.addLinkLabel ('chunky link')">Link 13</A>
<A HREF="link14.html">Link 14</A>

 Music.sonifyFormsWithGroovoids

 
 CATEGORY   Static Method 
 MODULE   Music Object Extension - Wizards 
 Min. Player Version   n/a 
 

The Music.sonifyFormsWithGroovoids static method lets you easily sonify all of the form elements on an HTML page using Groovoids.

SYNTAX    Music.sonifyFormsWithGroovoids (
    TargetMusicObjectOBJ ,
    CheckboxCheckGroovoidNameSTR ,
    CheckboxUncheckGroovoidNameSTR ,
    RadioButtonClickGroovoidNameSTR ,
    ListFocusGroovoidNameSTR ,
    ListChooseGroovoidNameSTR ,
    ListBlurGroovoidNameSTR ,
    MultilistFocusGroovoidNameSTR ,
    MultilistChooseGroovoidNameSTR ,
    MultilistBlurGroovoidNameSTR ,
    TextboxFocusGroovoidNameSTR ,
    TextboxBlurGroovoidNameSTR ,
    ButtonClickGroovoidNameSTR ,
    FormResetGroovoidNameSTR ,
    FormSubmitGroovoidNameSTR ,
    UpdateTypeSTR ,
    WindowHandleOBJ
)

The various parameters of this method (described in further detail below) let you choose which Groovoids are to play for the various form element events.

PARAMETERS
SPECIAL VALUES
VARIATIONS
NOTES
 Music.sonifyFormsWithHandlers

 
 CATEGORY   Static Method 
 MODULE   Music Object Extension - Wizards 
 Min. Player Version   n/a 
 

The Music.sonifyFormsWithHandlers static method lets you easily sonify all of the form elements on an HTML page using handlers.

SYNTAX    Music.sonifyFormsWithHandlers (
    CheckboxCheckJavaScriptSTR ,
    CheckboxUncheckJavaScriptSTR ,
    RadioButtonClickJavaScriptSTR ,
    ListFocusJavaScriptSTR ,
    ListChooseJavaScriptSTR ,
    ListBlurJavaScriptSTR ,
    MultilistFocusJavaScriptSTR ,
    MultilistChooseJavaScriptSTR ,
    MultilistBlurJavaScriptSTR ,
    TextboxFocusJavaScriptSTR ,
    TextboxBlurJavaScriptSTR ,
    ButtonClickJavaScriptSTR ,
    FormResetJavaScriptSTR ,
    FormSubmitJavaScriptSTR ,
    UpdateTypeSTR ,
    WindowHandleOBJ
)

The various parameters of this method (described in further detail below) let you specify the JavaScript code that is to be executed for the various form element events.

PARAMETERS
SPECIAL VALUES
VARIATIONS
NOTES
 Music.sonifyLinksWithGroovoids

 
 CATEGORY   Static Method 
 MODULE   Music Object Extension - Wizards 
 Min. Player Version   n/a 
 

The Music.sonifyLinksWithGroovoids static method lets you easily sonify all (or a subset) of the links on an HTML page using Groovoids.

SYNTAX    Music.sonifyLinksWithGroovoids (
    TargetMusicObjectOBJ ,
    LinkClickGroovoidNameSTR ,
    LinkOverGroovoidNameSTR ,
    LinkOutGroovoidNameSTR ,
    LinkHoverGroovoidNameSTR ,
    LinkHoverDelayMsINT ,
    StartLinkLabelSTR ,
    EndLinkLabelSTR ,
    LinkLabelPrefixSTR ,
    UpdateTypeSTR ,
    WindowHandleOBJ
)

The various parameters of this method (described in further detail below) let you choose which Groovoids are to play for the various link events, and also which links are to be sonified. Using the StartLinkLabelSTR, EndLinkLabelSTR, and LinkLabelPrefixSTR parameters, it is possible to identify exact groups of links that are to be sonified using this method. The method can be used several times to sonify different groups of links in different ways.

PARAMETERS

Sonification of links using this method is cumulative by default (unless you specify a value for the UpdateTypeSTR parameter), so you can use the method multiple times to add further sonification. In the following example, all the links inside a document are being sonified so that their click events play the Groovoid UI-Choice, whereas only the subset of links from the link labeled "start chunky links" to the link labeled "end chunky links" are sonified so that their onMouseOver and hover events also play Groovoids.

<HTML><HEAD><TITLE>Link Sonification Example</TITLE></HEAD>
<BODY ONLOAD="sonifyLinks ()">

<SCRIPT SRC="music-object.js></SCRIPT>
<SCRIPT SRC="music-object-x-wizards.js></SCRIPT>

<A HREF="link01.html">Link 01</A>
<A HREF="link02.html">Link 02</A>
<A HREF="link03.html">Link 03</A>
<A HREF="link04.html">Link 04</A>
<A HREF="link05.html" ONCLICK="Music.addLinkLabel ('start chunky links')">Link 05</A>
<A HREF="link06.html">Link 06</A>
<A HREF="link07.html">Link 07</A>
<A HREF="link08.html">Link 08</A>
<A HREF="link09.html">Link 09</A>
<A HREF="link10.html">Link 10</A>
<A HREF="link11.html" ONCLICK="Music.addLinkLabel ('end chunky links')">Link 11</A>
<A HREF="link12.html">Link 12</A>
<A HREF="link13.html">Link 13</A>
<A HREF="link14.html">Link 14</A>

<SCRIPT LANGUAGE=JavaScript><!-- //

groovoidPlayer = new Music ();

function sonifyLinks () {
   Music.sonifyLinksWithGroovoids (
      groovoidPlayer,
      'UI-Choice1'
   );
   Music.sonifyLinksWithGroovoids (
      groovoidPlayer,
      '',
      'UI-Click17',
      '',
      'UI-MouseOver2',
      500,
      'start chunky links',
      'end chunky links'
   );
}

groovoidPlayer.stubEmbed ('stub.rmf');

// --></SCRIPT>

</BODY></HTML>

SPECIAL VALUES
VARIATIONS
NOTES
 Music.sonifyLinksWithHandlers

 
 CATEGORY   Static Method 
 MODULE   Music Object Extension - Wizards 
 Min. Player Version   n/a 
 

The Music.sonifyLinksWithHandlers static method lets you easily sonify all (or a subset) of the links on an HTML page using handlers.

SYNTAX    Music.sonifyLinksWithHandlers (
    LinkClickJavaScriptSTR ,
    LinkOverJavaScriptSTR ,
    LinkOutJavaScriptSTR ,
    LinkHoverJavaScriptSTR ,
    LinkHoverDelayMsINT ,
    StartLinkLabelSTR ,
    EndLinkLabelSTR ,
    LinkLabelPrefixSTR ,
    UpdateTypeSTR ,
    WindowHandleOBJ
)

The various parameters of this method (described in further detail below) let you choose which handlers are to be executed for the various link events, and also which links are to be sonified. Using the StartLinkLabelSTR, EndLinkLabelSTR, and LinkLabelPrefixSTR parameters, it is possible to identify exact groups of links that are to be sonified using this method. The method can be used several times to sonify different groups of links in different ways.

PARAMETERS

Sonification of links using this method is cumulative by default (unless you specify a value for the UpdateTypeSTR parameter), so you can use the method multiple times to add further sonification. In the following example, all the links inside a document are being sonified so that their click events play the percussion instrument "Ice Cube" (bank 1, program 198), whereas only the subset of links from the link labeled "start chunky links" to the link labeled "end chunky links" are sonified so that their onMouseOver events also play the percussion instrument "Tablaesque - Low" (bank 1, program 174).

<HTML><HEAD><TITLE>Link Sonification Example</TITLE></HEAD>
<BODY ONLOAD="sonifyLinks ()">

<SCRIPT SRC="music-object.js></SCRIPT>
<SCRIPT SRC="music-object-x-wizards.js></SCRIPT>

<A HREF="link01.html">Link 01</A>
<A HREF="link02.html">Link 02</A>
<A HREF="link03.html">Link 03</A>
<A HREF="link04.html">Link 04</A>
<A HREF="link05.html" ONCLICK="Music.addLinkLabel ('start chunky links')">Link 05</A>
<A HREF="link06.html">Link 06</A>
<A HREF="link07.html">Link 07</A>
<A HREF="link08.html">Link 08</A>
<A HREF="link09.html">Link 09</A>
<A HREF="link10.html">Link 10</A>
<A HREF="link11.html" ONCLICK="Music.addLinkLabel ('end chunky links')">Link 11</A>
<A HREF="link12.html">Link 12</A>
<A HREF="link13.html">Link 13</A>
<A HREF="link14.html">Link 14</A>

<SCRIPT LANGUAGE=JavaScript><!-- //

notePlayer = new Music ();

function sonifyLinks () {
   Music.sonifyLinksWithHandlers (
      'notePlayer.playNote (1,1,198,73,127,1000)'
   );
   Music.sonifyLinksWithGroovoids (
      '',
      'notePlayer.playNote (1,1,174,73,127,1000)',
      '',
      '',
      null,
      'start chunky links',
      'end chunky links'
   );
}

notePlayer.stubEmbed ('stub.rmf');

// --></SCRIPT>

</BODY></HTML>

SPECIAL VALUES
VARIATIONS
NOTES
Static Properties

 Music.noManualHandlers

 
 CATEGORY   Static Property 
 MODULE   Music Object Extension - Wizards 
 Type   boolean 
 Default Value   false 
 Access   read / write 
 

The Music.noManualHandlers static property is a boolean variable, indicating if the HTML elements that are to be automatically sonified have no manually coded event handlers.

The default value of this property is false, and the property should only be set to true if it is known for certain that none of the HTML elements that may be automatically sonified by methods of the Wizards extension have pre-existing event handlers in the HTML code.

A Bug in Netscape 6

The Music.noManualHandlers property was introduced at around the time that Netscape 6 was released. With the initial release of Netscape 6, it was discovered that this browser had a significant issue that could cause the automatic sonification of HTML elements (using the Wizards extension) to interfere with other aspects of the proper functioning of HTML pages. For a detailed explanation of this issue, consult the section Authoring Issues: Netscape 6 and Automatic Sonification.

The value of this property will be used to determine whether or not event handlers can be automatically attached to HTML elements in order to sonify them, if the user is browsing with Netscape 6. The property's value is considered at the time that any of the Music.sonifyFormsWithGroovoids, Music.sonifyFormsWithHandlers, Music.sonifyLinksWithGroovoids, or Music.sonifyLinksWithHandlers static methods are called. If the property is set to false at the time that any of these methods is called and the user is browsing with Netscape 6, then these methods will have no effect.

NOTES